var AliOrder = Vue.component('aliOrder', function (resolve, reject) {
    axios.get('views/aliOrder/aliOrder.html?timestamp=' + timestamp).then(function (res) {
        resolve({
            template: res.data,
            data() {
                return {
                    tableData: [],
                    searchForm: {},
                    pageInfo: {
                        currentPage: 1,
                        pageSize: 10,
                        srch_EQ_delete: false,
                        totalPage:1
                    },
                    formLabelWidth: '120px',
                    permssion: {}
                }
            },
            methods: {
                onSubmit: function () {
                    console.log(this.searchForm);
                    // this.pageInfo.currentPage=1;
                    this.$set(this.pageInfo,'currentPage',1);
                    this.list();
                },
                checkPermission: function (type) {
                    let checkArr = this.buttomPermission[type];
                    if (checkArr) {
                        for (var v in checkArr) {
                            if (this.permssion[checkArr[v]]) {
                                return true;
                            }
                        }
                    } else {
                        return true;
                    }
                    return false;
                },list:function(){
                    var url = APIs.aliorder.list+"/"+this.pageInfo.currentPage;
                    httpInvoker.post(url,this.searchForm).then(res=>{
                        if (res.status == 200 && res.data.status == '00') {
                            this.tableData = res.data.data.content;
                            this.pageInfo.totalPage = res.data.data.totalElements; 
                        }else {
                            this.$alert(res.data.msg, '', {
                                confirmButtonText: '确定'
                            });
                        }
                        
                    }).catch(()=>{

                    });
                }, handleCurrentChange: function (currentPage) {
                    this.pageInfo.currentPage   = currentPage;
                    this.list();
                },query:function( row){
                   var json ={id: row.id,pid:row.inPayId};
                   var url = APIs.aliorder.query;
                   httpInvoker.post(url,json).then(res=>{
                    if (res.status == 200 && res.data.status == '00' ) {
                            var msg = '订单已完成冻结金额';
                        this.$alert(msg, '', {
                            confirmButtonText: '确定'
                        });
                    }else {
                        this.$alert(res.data.msg, '', {
                            confirmButtonText: '确定'
                        });
                    }
                    
                }).catch(()=>{

                });
                }
                 
            },
            created: function () {
                var json = CommonUtils.getPermissionJson();
                this.permssion = json;
                this.list();
               
            },destroyed:function(){
                
            }
            
        })
    })
})